package com.boot.mgt.service.impl

import com.boot.core.result.ResultEnum
import com.boot.core.result.ResultTo
import com.boot.mgt.dao.mysql.TaStreetMapper
import com.boot.mgt.model.TaStreet
import com.boot.mgt.service.TaStreetService
import com.googlecode.jsonrpc4j.spring.AutoJsonRpcServiceImpl
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@AutoJsonRpcServiceImpl
@Service
class TaStreetServiceImpl : TaStreetService {

    @Autowired
    protected lateinit var streetMapper: TaStreetMapper

    override fun select(district_id: Int): ResultTo {
        TaStreet().apply {
            districtId = district_id
            return ResultTo().setData("street_list", streetMapper.select(this))
        }
        return ResultTo(ResultEnum.OPERATION_FAILED)
    }
}